﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Taxomatic.aspx.cs" Inherits="Sukul.SharePoint.Taxomatic.Taxomatic"
    DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <link href="css/Taxomatic.css" rel="stylesheet" type="text/css" />
    <link href="css/start/jquery-ui-1.8.11.custom.css" rel="stylesheet" type="text/css" />
    <link href="css/dynatree/skin-vista/ui.dynatree.css" rel="stylesheet" type="text/css" />
    <link href="css/contextMenu/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="js/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
    <script src="js/jquery.dynatree.min.js" type="text/javascript"></script>
    <script src="js/jquery.MultiFile.js" type="text/javascript"></script>
    <script src="js/jquery.cookie.js" type="text/javascript"></script>
    <script src="js/taxomatic.js" type="text/javascript"></script>
    <script src="js/json2.js" type="text/javascript"></script>
    <script src="js/jquery.tmpl.js" type="text/javascript"></script>
    <script src="js/jquery.tmplPlus.js" type="text/javascript"></script>
    <script src="js/ajaxupload.js" type="text/javascript"></script>
    <script src="js/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="js/jcarousellite_1.0.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            Entry_Load();
        });
    </script>
    <script id="vw_Parent" type="text/x-jquery-tmpl">
    <ul style="display:none">
        {{each Payload}}
        <li id="${$value.Id}" termid="${$value.Id}" title="${$value.Name}" {{if $value.TaxonomyGroups.length>0}}class="folder"{{else}}class="item"{{/if}}>${$value.Name}
            <ul>
            {{each $value.TaxonomyGroups}}
                <li id="${$value.Id}" termid="${$value.Id}" title="${$value.Name}" {{if $value.Termsets.length>0}}class="folder"{{else}}class="item"{{/if}}>${$value.Name}
                    <ul>
                    {{each $value.Termsets}}
                        <li id="${$value.Id}" termid="${$value.Id}" title="${$value.Name}" {{if $value.Terms.length>0}}class="folder"{{else}}class="item"{{/if}}>${$value.Name}
                            {{tmpl($value) "#vw_Child"}}
                        </li>
                    {{/each}}
                    </ul>
                </li>
            {{/each}}
            </ul>
        </li>
        {{/each}}
    </ul>
    </script>
    <script id="vw_Child" type="text/x-jquery-tmpl">
     <ul>
            {{each Terms}}
                <li id="${$value.Id}" termid="${$value.Id}" title="${$value.Name}" {{if $value.Terms.length>0}}class="folder"{{else}}class="item"{{/if}}>${$value.Name}
                    {{if $value.Terms.length>0}}
                        {{tmpl($value) "#vw_Child"}}
                    {{/if}}
                </li>
            {{/each}}
    </ul>
    </script>
    <script id="vw_Term" type="text/x-jquery-tmpl">
    <div>
        <table>
        <tr>
            <td colspan="2">
                <input type="hidden" id="termid" value="${Id}" />
                <b>${Name}</b>
            </td>
        </tr>
        <tr>
            <td>
                <b>Available for Tagging </b>
                <p>
                Select whether this term is available to be used by end users for tagging. When unselected this term will be visible but not enabled in tagging tools. 
                </p>
            </td>
            <td>
                <input id="IsAvailableForTagging" type="checkbox" checked="${IsAvailableForTagging}" />
            </td>             
        </tr>
         <tr>
            <td>
                <b>Language </b>
                <p>
                Select a language of the labels for the term you would like to edit. 
                </p>
            </td>
            <td>
                 <select id="language">
                    <option value="1033">English</option>
                    <option value="2333">German</option>
                    <option>Tea</option>
                </select>
            </td>             
        </tr>
        <tr>
            <td>
                <b>Description</b>
                <p>
                Descriptions will help users know when to use this term, and to disambiguate amongst similar terms. 
                </p>
            </td>
            <td>
                <textarea id="Description" cols="40" rows="5">${Description}</textarea> 
            </td>             
        </tr>
        <tr>
            <td>
                <b>Default Label</b>
                <p>
                Enter one label as the default for this language.
                </p>
            </td>
            <td>
                <input id="DefaultLabel" type="text" value="${DefaultLabel}"/> 
            </td>             
        </tr>
        <tr>
            <td>
                <b>Other Labels</b>
                <p>
                Enter synonyms and abbreviations for this term. (You can enter a word or phrase per line.)
                </p>
            </td>
            <td>
                {{each Labels}}
                    {{if !IsDefaultForLanguage}}
                    <input type="text" value="${Value}"/><br/>
                    {{/if}}
                {{/each}}
            </td>             
        </tr>
        </table>
    </div>    
    </script>
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    Taxomatic - A Sukul Research Product
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    Taxomatic
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <div id="header">
        <h1>
            Taxomatic Termset Manager</h1>
        <input id="SelectedItems" type="hidden" />
        <div id="Progress" style="display: none">
            <img src="images/loading.gif" alt="Loading" width="20px" />
        </div>
    </div>
    <div>
        <hr />
        <div id="bannerOut">
            <div id="banner">
                <ul>
                    <li>Taxomatic Beta 2 released, check which version you are running by clicking on About</li>
                    <li>Support the project, donate at <a href="http://taxomatic.codeplex.com" target="_blank">http://taxomatic.codeplex.com</a></li>
                    <li>Synchronize your taxonomy between your SharePoint farms</li>
                    <li>Export you taxonomy from different farms and compare the differences using a file
                        comparer tool</li>
                    <li>Maintain governance of your taxonomy, get control back</li>
                    <li>Created by <a href="http://shailen.sukul.org" target="_blank">Shailen Sukul</a></li>
                </ul>
            </div>
        </div>
        <a id="btnExport" name="btnExport" onclick="javascript:function()" href="/_layouts/Sukul.SharePoint.Taxomatic/TaxomaticHandler.ashx?mode=export">
            Export Terms</a> <a id="btnImport" name="btnImport" onclick="javascript:NewItem2(event, &quot;/_layouts/Sukul.SharePoint.Taxomatic/ImportTaxonomy.aspx&quot;);
            javascript:return false;">Import Terms</a> <a id="btnVersion" name="btnVersion" onclick="javascript:NewItem2(event, &quot;/_layouts/Sukul.SharePoint.Taxomatic/Version.aspx&quot;);
            javascript:return false;">About</a>
        <hr />
    </div>
    <div id="container2">
        <div id="container1">
            <div id="col1">
                <!-- Definition of context menu -->
                <div id="tree">
                </div>
            </div>
            <div id="col2">
                <div id="divTerm">
                </div>
            </div>
        </div>
    </div>
    <div id="footer">
        <p>
            Taxomatic - A Sukul Research Project
        </p>
        <p>
            Copyright © 2011 Sukul.org
        </p>
    </div>
</asp:Content>
